package su.example.sms.domain.dto;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import su.example.sms.domain.entity.Student;

public class StudentPageMapper {

    public static Pageable getPageable(StudentPageDTO studentPageDTO) {
        return PageRequest.of(studentPageDTO.getPage(), studentPageDTO.getSize());
    }

    public static Student getStudent(StudentPageDTO studentPageDTO) {
        return new Student(null,
                studentPageDTO.getName(),
                studentPageDTO.getStudentId(),
                studentPageDTO.getClassId(),
                studentPageDTO.getGender()
        );
    }
}
